package com.bj58.migrate.helper;

import java.text.SimpleDateFormat;
import java.util.Date;


public class DateHelper{

	/**
	 * 根据时间格式返回相应的字符窜  yyyy-MM-dd HH:mm:ss
	 * 
	 * @param format
	 * @param date
	 * @return
	 * @throws Exception
	 */
	public static String convertDatetoString( String format, Date date ){

		SimpleDateFormat dateFormat = new SimpleDateFormat( format );
		return dateFormat.format( date );
	}

	public static void main( String[] args ){

		String time = DateHelper.convertDatetoString( "yyyy-MM-dd HH:mm:ss", new Date() );
		System.out.println( time );
	}

}
